package com.fengdi.everyday.middle;

import java.util.List;

/**
 * @Description 3350 检测相邻子数组
 * @Date 10:28
 */
public class MaxIncreasingSubarrays {

    public int maxIncreasingSubarrays(List<Integer> nums) {
        int cnt = 1;
        int precnt = 0;
        int ans = 0;
        for(int i = 1; i < nums.size(); i++) {
            if(nums.get(i) > nums.get(i - 1)) {
                cnt++;
            }else {
                precnt = cnt;
                cnt = 1;
            }
            ans = Math.max(ans, Math.min(cnt, precnt));
            ans = Math.max(ans, cnt / 2);
        }
        return ans;
    }

}
